__author__ = 'aminmahpour'
import re

f = open("tntcgcgaga_cons2.txt","r")
out = open("tntcgcgaga_cons_formated.txt", "w")
s = ""
j=0
k=0
l=[]
for i in f:

    m = re.search("\d+\t([-]?\d\.\d+)" ,i)
    if m is not None:
        k +=1
        l.append(m.group(1))
    m = re.search(("variable"), i)
    if m is not None:
        l.append("0")


print k/30
f.close()


j = 0
k = 0
for i in l:
    if i == "0":
        out.write("\n")
        print "\n"
    out.write("%s\t" % i)
    print ("%d %s" % (j,i))

print len (l)/30.00

out.close()